import React from 'react';
import { Button, message, Popconfirm, Modal, Icon } from 'antd';
import { WeaTab, WeaTools, WeaDialog, WeaSearchGroup, WeaFormItem, WeaRightMenu, WeaBrowser, WeaInput, WeaInputNumber,WeaSelect, WeaTextarea, WeaCheckbox, WeaError } from 'ecCom';
import {WeaLocaleProvider} from 'ecCom';
let Base64 = ecCom.WeaTools.Base64
const getLabel = WeaLocaleProvider.getLabel;
import SynergyParams4Report from './synergy/SynergyParams4Report';
import { EchartTemplate, EchartColorScheme } from '../../echart/';

// 图表元素，数据来源
class Content_reportForm_DataSource extends React.Component {
    state = {
        id: this.props.tabData.id,
        title: this.props.tabData.title || '',
        reportFormType: this.props.tabData.reportFormType || this.props.tabNew.reportFormType.selected,
        decimalDigits: this.props.tabData.decimalDigits || this.props.tabNew.decimalDigits,
        reportFormWidth: this.props.tabData.reportFormWidth || this.props.tabNew.reportFormWidth,
        reportFormHeight: this.props.tabData.reportFormHeight || this.props.tabNew.reportFormHeight,
        dataSource: this.props.tabData.dataSource || this.props.tabNew.dataSource.selected,
        reportFormSql: this.props.tabData.reportFormSql,
        showLegend: this.props.tabData.showLegend || '1',
        echartColorScheme: this.props.tabData.echartColorScheme || '0',
        tiltShow: this.props.tabData.tiltShow || '0',
        isSaveTemplate: false
    };

    constructor(props) {
        super(props);
        this.getButtons = this.getButtons.bind(this);
        this.onOk = this.onOk.bind(this);
        this.onCancel = this.onCancel.bind(this);
    }

    render() {
        const {eid, tabNew, tabData, synergyParams,hpid,subCompanyId} = this.props;
        const {stype, pagetype, ispagedeal} = synergyParams;
        const {title, reportFormType, decimalDigits, reportFormWidth, reportFormHeight,
            dataSource, reportFormSql, isSaveTemplate, showLegend, tiltShow, echartColorScheme} = this.state;
        let _reportFormWidth=reportFormWidth;
        if(reportFormWidth==undefined){
            _reportFormWidth=this.props.tabNew.reportFormWidth;
        }
        let _reportFormHeight=reportFormHeight;
        if(reportFormHeight==undefined){
            _reportFormHeight=this.props.tabNew.reportFormHeight;
        }
        return (
            <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@nc2izp`}
                className="portal-esetting-dialog"
                visible={true}
                title={getLabel(19480, '内容设置')}
                icon="icon-coms-portal"
                iconBgcolor='#1a57a0'
                style={{width: 660, height: 426}}
                hasScroll={true}
                buttons={this.getButtons()}
                onCancel={this.onCancel}
            >
                <WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@1adp7v`} title={getLabel(33396, '设置项')} needTigger={true} showGroup={true}>
                    <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@9y9aga`} label={getLabel(84022, '图表标题')} labelCol={{span: 6}} wrapperCol={{span: 16}}>
                        <WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@gw34ll`}
                            style={{width: '100%'}}
                            ref={el => {this.title = el}}
                            error={getLabel(385021, '数据为空')}
                            tipPosition={'bottom'}>
                            <WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@s1xaax`} inputType="multilang" isBase64={true} value={title} viewAttr={3} onChange={value => this.setState({title: value})}/>
                        </WeaError>
                    </WeaFormItem>
                    <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@a4z235`} label={getLabel(84021, '图表类型')} labelCol={{span: 6}} wrapperCol={{span: 16}}>
                        <EchartTemplate ecId={`${this && this.props && this.props.ecId || ''}_EchartTemplate@ezexem`} sysDatas={tabNew.reportFormType.options } value={reportFormType} onChange={value=>this.setState({reportFormType: value})}/>
                    </WeaFormItem>
                    <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@u9mxao`} label={getLabel(516815,'坐标轴文字倾斜显示') } labelCol={{span: 6}} wrapperCol={{span: 16}}>
                        <WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@cz3a4l`}
                            display="switch"
                            value={tiltShow}
                            onChange={(v)=> {this.setState({tiltShow : v})}}
                        />
                    </WeaFormItem>
                    <EchartColorScheme ecId={`${this && this.props && this.props.ecId || ''}_EchartColorScheme@5ga4ft`} ref={'echartColorScheme'} options={tabNew.colorSchemeOptions} value={echartColorScheme} eid={eid} hpid={hpid} subCompanyId={subCompanyId}/>
                    <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@gfiy44`} label={getLabel(15212, '小数位数')} labelCol={{span: 6}} wrapperCol={{span: 16}}>
                        <WeaInputNumber ecId={`${this && this.props && this.props.ecId || ''}_WeaInputNumber@zmd4yf`} value={decimalDigits}  min={0} onChange={value => this.setState({decimalDigits: value})}/>
                    </WeaFormItem>
                    <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@drye6j`} label={getLabel(84023, '图表大小')} labelCol={{span: 6}} wrapperCol={{span: 16}} style={{lineHeight:'30px'}}>
                        <div style={{verticalAlign:'middle',width:'50px', display: 'inline-block'}}>{getLabel(386529, '宽度：')}</div>
                        <WeaInputNumber ecId={`${this && this.props && this.props.ecId || ''}_WeaInputNumber@5u1wdq`} value={_reportFormWidth}  min={1} style={{width: '128px', marginRight: '26px'}} onBlur={(value)=>{if(value==''){this.setState({reportFormWidth:200})}}} onChange={(value) =>{this.setState({reportFormWidth:value});}}/>
                        <div style={{verticalAlign:'middle',width:'50px', display: 'inline-block'}}>{getLabel(386530, '高度：')}</div>
                        <WeaInputNumber ecId={`${this && this.props && this.props.ecId || ''}_WeaInputNumber@hulgcg`} value={_reportFormHeight}  min={1} style={{width: '128px'}}  onBlur={(value)=>{if(value==''){this.setState({reportFormHeight:200})}}} onChange={(value) => {this.setState({reportFormHeight: value});}}/>
                    </WeaFormItem>
                    <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@kcfudw`} label={getLabel(28006, '数据来源')} labelCol={{span: 6}} wrapperCol={{span: 16}}>
                        <WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@472ygb`}
                            options={
                                tabNew.dataSource.options.map((item) => {
                                    return {key: item.key, selected: false, showname: item.value};
                                })
                            }
                            value={dataSource}
                            // style={{width: '200px'}}
                            onChange={value => {
                                this.setState({dataSource: value});
                            }}
                        />
                    </WeaFormItem>
                    <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@v1bap2`} label={getLabel(84025, '图表来源')} labelCol={{span: 6}} wrapperCol={{span: 16}}>
                        <div className="portal-esetting-reportform-template-btns">
                            <div style={{display: 'inline-block', paddingRight: '45px', lineHeight: '16px'}}>
                                <span style={{paddingRight: '5px'}}>{getLabel(127215,"保存到模板库")}</span>
                                <WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@qs6y6p`}
                                    helpfulTip={getLabel(390861,"是否保存到模板库")}
                                    onChange={() => this.setState({isSaveTemplate: !isSaveTemplate})}
                                />
                            </div>
                            <span className="synergy-setting-btn" onClick={() => this.sp4r.onShow()}>{getLabel(33749, '系统变量')}</span>
                            {stype == 'wf' && pagetype == 'operat' && ispagedeal == '1' ? <span className="synergy-setting-btn" onClick={() => this.sp4r.onShow(synergyParams)}>{getLabel(130009, '表单变量')}</span> : ''}
                            <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@9x0ye9`}
                                type={'reportformsqltemplate'}
                                inputStyle={{width:'373px'}}
                                title={getLabel(386595, '选择SQL模板')}
                                hasAdvanceSerach={true}
                                isSingle={true}
                                icon='icon-coms-portal'
                                iconBgcolor='#1a57a0'
                                customized
                                onChange={(ids, names, datas)=>{
                                    if(datas[0]){
                                        this.setState({reportFormSql: datas[0].reportformsql});
                                    }
                                }}
                            >
                               <span className="synergy-setting-btn">{getLabel(386596, 'SQL模板')}</span>
                            </WeaBrowser>
                            <SQLTemplate ecId={`${this && this.props && this.props.ecId || ''}_SQLTemplate@jnjcfp`} ref="SQLTemplate" onEdit={(sqlitem)=>this.refs.SaveSQLTemplate.setState({...sqlitem, visible: true})}/>
                        </div>
                        <WeaTextarea ecId={`${this && this.props && this.props.ecId || ''}_WeaTextarea@rwy428`}
                            value={reportFormSql}
                            minRows={5}
                            onChange={value => {
                                this.setState({reportFormSql: value})
                            }}
                        />
                        <SynergyParams4Report ecId={`${this && this.props && this.props.ecId || ''}_SynergyParams4Report@swo09i`} ref={(sp4r) => this.sp4r = sp4r}/>
                        <SaveSQLTemplate ecId={`${this && this.props && this.props.ecId || ''}_SaveSQLTemplate@lqfikj`} ref="SaveSQLTemplate" onRefresh={()=>this.refs.SQLTemplate.getSessionKey()} reportFormSql={reportFormSql}/>
                        <WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@xqkrfd`} value={showLegend} onChange={(v) => this.setState({showLegend: v})} style={{margin: '12px 10px 0px 0px'}}/>
                        <span>{getLabel(515935,'显示图例') }</span>
                    </WeaFormItem>
                </WeaSearchGroup>
            </WeaDialog>
        );
    }

    getButtons() {
        let buttons = [];
        buttons.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@eajvhy`} type="primary" onClick={this.onOk}>{getLabel(826, '确定')}</Button>);
        buttons.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@29flpb`} type="ghost" onClick={this.onCancel}>{getLabel(31129, '取消')}</Button>);
        return buttons;
    }

    onOk() {
        const { isSaveTemplate } = this.state;
        if (!this.state.title) {
            this.title.showError();
        } else {
                this.props.onOk({...this.state, echartColorScheme: this.refs.echartColorScheme ? this.refs.echartColorScheme.state.value: ''});
                isSaveTemplate && this.onAddSqlTemplate(); 
        }
    }

    onCancel() {
        this.props.onCancel();
    }

    onAddSqlTemplate(){
        const { title, reportFormSql } = this.state;
        WeaTools.callApi('/api/portal/sqltemplate/update', 'POST', {id: '', title, reportFormSql}).then(result=> {
            if(result.api_status == '2'){
                message.error(result.error_msg);
            }else{
                message.success(getLabel(83551,"保存成功！"));
                this.setState({
                    visible: false,
                });
            }
        });
    }
}

export default Content_reportForm_DataSource;

import { WeaTableNew, WeaLogView } from 'comsMobx';
const {LogStore} = WeaLogView;
const logStore =  new LogStore();
const WeaLogViewComp = WeaLogView.Component;
const { WeaTable, TableStore } = WeaTableNew;
const tableStore = new TableStore();
class SQLTemplate extends React.Component {
    constructor(props) {
        super(props);
        this.getButtons = this.getButtons.bind(this);
        this.getSessionKey = this.getSessionKey.bind(this);
        this.getRightMenu = this.getRightMenu.bind(this);
        this.onRightMenuClick = this.onRightMenuClick.bind(this);
        this.onOperatesClick = this.onOperatesClick.bind(this);
        this.onSubmit = this.onSubmit.bind(this);
        this.doDelete = this.doDelete.bind(this);
        this.deleteRows = this.deleteRows.bind(this);
        this.onLogVisibleChange = this.onLogVisibleChange.bind(this);
        this.state = {
            sessionkey:'',
            loading: false,
            visible: false,
            title: '',
            creator: '',
            replaceDatas: [],
            showSearchAd: false,
            selectedRowKeys: '',
            logVisible: false,
        }
    }
    getSessionKey(params = {}){
        this.setState({visible: true, loading: true});
        if (this.state.sessionkey) {
            const { current = 1 } = tableStore;
            if (!params.current) {
                params.current = current;
            }
        }
        if(params.title === undefined){
            params.title = this.state.title;
        }
        if(params.creator === undefined){
            params.creator = this.state.creator;
        }
        WeaTools.callApi('/api/portal/sqltemplate/datas', 'POST', params).then(data => {
            const status = data.status || '1';
            if (status == '1') {
                this.setState({
                    sessionkey: data.sessionkey,
                    loading: false,
                    title: params.title,
                    creator: params.creator,
                    showSearchAd: false,
                    selectedRowKeys: '',
                });
                tableStore.getDatas(data.sessionkey,  1);
            }else if(status == '2'){
                message.error(data.errormsg);
                return;
            }
        });
    }
    onSubmit(){
        const { id, reportFormSql } = this.state;
        if(id){
           this.props.onChange(reportFormSql);
        }
        this.setState({visible: false});
    }
    getButtons(){
        const { selectedRowKeys } = this.state;
        let btns = [];
        btns.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ee86k0`} type="primary" onClick={()=>this.props.onEdit({id:'', title: '', reportFormSql: '', type: 'add'})}>{getLabel(365, '新建')}</Button>);
        btns.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@n4n6zd`} type="primary" onClick={this.deleteRows} disabled={!selectedRowKeys}>{getLabel(32136, '批量删除')}</Button>)
        return btns
    }
    deleteRows(){
        let ids = "";
        if(this.state.sessionkey){
            const { selectedRowKeys } = tableStore;
            ids = selectedRowKeys.join(",");
        }
        this.doDelete(ids);
    }
    doDelete(ids){
        Modal.confirm({
            title: '信息确认',
            content: getLabel(15097,'确定要删除吗？'),
            onOk: () => {
                WeaTools.callApi('/api/portal/sqltemplate/delete', 'POST', {ids}).then((data) => {
                    if (data.api_status === 'success') {
                        message.success(getLabel(83472, "删除成功！"));
                        this.getSessionKey();
                    } else {
                        message.error(getLabel(83473, "删除失败！"));
                    }
                });
            },
        });
    }
    getRightMenu(){
        const { selectedRowKeys } = this.state;
        let btns = [];
        btns.push({
            icon: <i className='icon-coms-Preservation'/>,
            content:getLabel(365, '新建')
        });
        btns.push({
            icon: <i className='icon-coms-go-back'/>,
            disabled: !selectedRowKeys,
            content:getLabel(32136, '批量删除')
        });
        btns.push({key: 'log', icon: <i className='icon-coms-Print-log'/>, content: getLabel(83, '日志'), onClick: this.onLogVisibleChange});
        return btns
    }
    onRightMenuClick(key){
        switch(key){
            case '0':
                this.props.onEdit({id:'', title: '', reportFormSql: '', type: 'add'});
                break;
            case '1':
                this.deleteRows();
                break;
        }
    }
    onOperatesClick(record,index,operate,flag){
        const id = record.randomFieldId;
        switch(operate.index){
            case '0':
                this.props.onEdit({id, title: record.title, reportFormSql: record.reportformsql, type: 'edit'});
                break;
            case '1':
                this.doDelete(id);
                break;
            case '2':
                break;
        }
    }
    onLogVisibleChange() {
        const { logVisible }= this.state;
        this.setState({
            logVisible: !logVisible
        });
    }

    onEnterSearch(){
        this.getSessionKey();
    }

    render() {
        const { visible, loading, datas, title, replaceDatas, logVisible } = this.state;
        let rowSelection = {
            onChange:(selectedRowKeys, selectedRows) => {
                this.setState({selectedRowKeys: `${selectedRowKeys}`});
            }
        }
        return <div style={{display: 'inline-block'}}>
                <div><Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@nu4vgw`} type="setting" title={getLabel(388014,"sql模板管理")} className="synergy-setting-btn synergy-setting-btn-setting" onClick={()=>this.getSessionKey({title:'',creator:'',current:1})}/></div>
                <WeaLogViewComp ecId={`${this && this.props && this.props.ecId || ''}_WeaLogViewComp@5g81eb`} visible={logVisible} onCancel={this.onLogVisibleChange} logStore={logStore} logType="6" logSmallType="25"/>
                <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@ch1xbi`}
                    title={getLabel(388014,"sql模板管理")}
                    visible={visible} 
                    closable={true}
                    onCancel={()=>this.setState({visible: false})}
                    icon='icon-coms-portal'
                    iconBgcolor='#1a57a0'
                    maskClosable={false}
                    buttons={this.getButtons()}
                    style={{width: 900, height: 520}}
                  >
                  <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@wl3oaw`} datas={this.getRightMenu()} onClick={this.onRightMenuClick}>
                    <div>
                        <div style={{lineHeight: '60px'}}>
                            <WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@g8suec`}
                                datas={[]}
                                searchType={['base','advanced']}
                                showSearchAd={this.state.showSearchAd}
                                searchsBaseValue={title}
                                setShowSearchAd={bool=>{
                                    this.setState({
                                        showSearchAd: bool
                                    })
                                }}
                                buttonsAd={[
                                    (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@v12vbv`} type="primary" onClick={()=>this.getSessionKey()}>{getLabel(197, '搜索')}</Button>),
                                    (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@fccyzx`} type="ghost" onClick={()=>this.setState({
                                        title: '',
                                        creator: '',
                                        replaceDatas: [],
                                    })}>{getLabel(2022, '重置')}</Button>),
                                    (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@82bbw4`} type="ghost" onClick={()=>this.setState({
                                        showSearchAd: false
                                    })}>{getLabel(31129, '取消')}</Button>)
                                ]}
                                advanceHeight={108}
                                searchsAd={<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@681a7f`} needTigger={false} showGroup={true} items={[
                                    {com:<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@swuqnk`}
                                          label={getLabel(33439, "名称")}
                                          labelCol={{span: 6}}
                                          wrapperCol={{span: 18}}>
                                            <div style={{marginTop:'5px'}}>
                                                <WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@0qt8ra`} value={title} onChange={value=>this.setState({title: value})} onEnterSearch={this.onEnterSearch.bind(this)}/>
                                            </div>
                                        </WeaFormItem>,
                                    colSpan:1
                                    },
                                    {com:<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@6bnpyv`}
                                          label={getLabel(882,"创建人")}
                                          labelCol={{span: 6}}
                                          wrapperCol={{span: 18}}>
                                            <div style={{marginTop:'19px'}}><WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@9z32t7`}
                                                type={'17'}
                                                replaceDatas={replaceDatas}
                                                hasAdvanceSerach={true}
                                                title={getLabel(83496,"多人力资源")}
                                                isSingle={false}
                                                onChange={(ids, names, datas)=>{
                                                    this.setState({creator: `${ids}`, replaceDatas: datas})
                                                }}
                                            /></div>
                                        </WeaFormItem>,
                                    colSpan:1}
                                ]}/>}
                                keyParam="viewcondition"  //主键
                                countParam="groupid" //数量
                                onSearch={()=>this.getSessionKey()}
                                onSearchChange={value=>this.setState({title: value})}
                            />
                        </div>
                        <div>
                            <WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@wn9pom`} needScroll={true} rowSelection={rowSelection} comsWeaTableStore={tableStore} onOperatesClick={this.onOperatesClick}/>
                        </div>
                    </div>
                </WeaRightMenu>
            </WeaDialog>
        </div>
    }
}
class SaveSQLTemplate extends React.Component {
    constructor(props) {
        super(props);
        this.getButtons = this.getButtons.bind(this);
        this.getRightMenu = this.getRightMenu.bind(this);
        this.onRightMenuClick = this.onRightMenuClick.bind(this);
        this.onSubmit = this.onSubmit.bind(this);
        this.state = {
            visible: false,
            id: '',
            type: '',
            title: '',
            reportFormSql: '',
        }
    }
    onSubmit(){
        const { id, type, title, reportFormSql } = this.state;
        if(!title.trim()){
            this.title.showError();
            return;
        }
        WeaTools.callApi('/api/portal/sqltemplate/update', 'POST', {id, title, reportFormSql}).then(result=> {
            if(result.api_status == '2'){
                message.error(result.error_msg);
            }else{
                this.props.onRefresh();
                message.success(getLabel(83551,"保存成功！"));
                this.setState({
                    visible: false,
                });
            }
        });
    }
    getButtons(){
        let btns = [];
        btns.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@39t3wa`} type="primary" onClick={this.onSubmit}>{getLabel(826, '确定')}</Button>);
        btns.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ilh39g`} onClick={()=>this.setState({visible:false})}>{getLabel(31129, '取消')}</Button>)
        return btns
    }
    getRightMenu(){
        let btns = [];
        btns.push({
            icon: <i className='icon-coms-Preservation'/>,
            content:getLabel(826, '确定')
        });
        btns.push({
            icon: <i className='icon-coms-go-back'/>,
            content:getLabel(31129, '取消')
        });
        return btns
    }
    onRightMenuClick(key){
        switch(key){
            case '0':
                this.onSubmit();
                break;
            case '1':
                this.setState({visible:false});
                break;
        }
    }
    render() {
        const { title, visible, reportFormSql } = this.state;
        let d_title = getLabel(388015,"编辑sql模板");

        return <div style={{display: 'inline-block'}}>
                <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@onelzv`}
                    title={d_title}
                    visible={visible}
                    closable={true}
                    onCancel={()=>this.setState({visible: false})}
                    icon='icon-coms-portal'
                    iconBgcolor='#1a57a0'
                    maskClosable={false}
                    buttons={this.getButtons()}
                    zIndex={1051}
                    style={{width: 600, height: 300}}
                  >
                  <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@csdc69`} datas={this.getRightMenu()} onClick={this.onRightMenuClick}>
                  <div style={{width: '90%', margin: '0 auto', paddingTop: '22px'}}>
                      <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@hqo1xg`}
                          label={getLabel(33439, '名称')}
                          labelCol={{span: 6}}
                          wrapperCol={{span: 18}}>
                          <WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@zmes5w`}
                              style={{width: '100%'}}
                              ref={el => {this.title = el}}
                              error={getLabel(385021, '数据为空')}
                              tipPosition={'bottom'}>
                              <WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@q278qv`} viewAttr={3} style={{width: 280}} fieldName="title" value={title} onChange={value=>this.setState({title: value})}/>
                          </WeaError>
                      </WeaFormItem>
                      <div style={{marginTop: '35px'}}>
                          <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@e4vjf1`} label={getLabel(28479,"SQL语句")} labelCol={{span: 6}} wrapperCol={{span: 16}}>
                              <WeaTextarea ecId={`${this && this.props && this.props.ecId || ''}_WeaTextarea@0z40wj`}
                                  value={reportFormSql}
                                  minRows={5}
                                  onChange={value => {
                                      this.setState({reportFormSql: value})
                                  }}
                              />
                          </WeaFormItem>
                      </div>
                    </div>
                </WeaRightMenu>
            </WeaDialog>
        </div>
    }
}